<template>
	<view>
		<view class="search">
			<uni-search-bar @confirm="search" @input="input" @cancel="cancel"  />
		</view>
		<vrow class="row">
			<vcol span="30">
				<view class="attr-col" v-for="(item, index) in attrs" :index="index" :key="index">
					<text class="text">{{ item.text }}</text>
				</view>
			</vcol>
			<vcol span="70">
				<view>
					<uni-grid :column="2" :show-border="false" :highlight="true" @change="change">
						<uni-grid-item v-for="(item, index) in list" :index="index" :key="index">
							<view class="grid-item-box">
								<image :src="item.url" class="image" mode="aspectFill" />
								<text class="text">{{ item.text }}</text>
							</view>
						</uni-grid-item>
					</uni-grid>
				</view>
			</vcol>
		</vrow>
	</view>
</template>

<script>
	import vrow from '@/components/lml-layout/row.vue'
	import vcol from '@/components/lml-layout/col.vue'
	import uniSection from '@/components/uni-section/uni-section.vue'
	import uniGrid from '@/components/uni-grid/uni-grid.vue'
	import uniGridItem from '@/components/uni-grid-item/uni-grid-item.vue'
	import uniSearchBar from '@/components/uni-search-bar/uni-search-bar.vue'
	export default {
		components: {
			vrow,
			vcol,
			uniSection,
			uniGrid,
			uniGridItem,
			uniSearchBar
		},
		data() {
			return {
				attrs: [{
					text: 'KUKA库卡'
				}, {
					text: 'ABB'
				}, {
					text: 'Fanun发那科'
				}, {
					text: '西门子'
				}, {
					text: 'Yaskawa安川'
				}, {
					text: '川崎Kawasaki'
				}, {
					text: '宝武'
				}, {
					text: '新松SIASUN'
				}],
				list: [{
						url: '/static/images/u0.svg',
						text: '扫一扫',
						badge: '0',
						type: "primary"
					},
					{
						url: '/static/images/u1.svg',
						text: '现场视频',
						badge: '1',
						type: "success"
					},
					{
						url: '/static/images/u2.svg',
						text: 'My Robot',
						badge: '99',
						type: "warning"
					},
					{
						url: '/static/images/u3.svg',
						text: '服务中心',
						badge: '99',
						type: "warning"
					}
				]
			}
		},
		onLoad: function(option) { //option为object类型，会序列化上个页面传递的参数
			//console.log(); //打印出上个页面传递的参数。
		}
	}
</script>

<style>
	/* 头条小程序组件内不能引入字体 */
	/* #ifdef MP-TOUTIAO */
	@font-face {
		font-family: uniicons;
		font-weight: normal;
		font-style: normal;
		src: url('~@/static/uni.ttf') format('truetype');
	}

	/* #endif */

	/* #ifndef APP-NVUE */
	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #062450;
		min-height: 100%;
		height: auto;
		color: #fff;
	}

	view {
		font-size: 14px;
		line-height: inherit;
	}

	/* #endif */
	.attr-col {
		height: 50px;
		line-height: 50px;
		text-align: center;
		border-top: 1px solid #fff;
		border-right: 1px solid #fff;
	}

	.attr-col:last-child {
		border-bottom: 1px solid #fff;
	}

	.image {
		width: 50rpx;
		height: 50rpx;
	}

	.text {
		font-size: 26rpx;
		margin-top: 10rpx;
	}


	.grid-dynamic-box {
		margin-bottom: 15px;
	}

	.grid-item-box {
		flex: 1;
		/* position: relative;
	*/
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}
	.uni-searchbar{
		background-color: #062450 !important ;
	}





	.search {
		padding: 0;
	}
</style>
